package com.zhonglz.util.hex;

import java.io.IOException;

import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;

public class HexUtils {
	
	public static byte[] decodeHex(String str) throws IOException, DecoderException{
    	byte[] decodeHex = Hex.decodeHex(str.toCharArray());
		return decodeHex;
    }

    public static String encodeHex(byte[] bytes){
    	String encodeHex = Hex.encodeHexString(bytes);
		return encodeHex;
    }
}
